package com.hdoit.kylin.web.money.modelconfig;

import com.hdoit.kylin.web.money.providers.MoneyTypeOwnProvider;
import com.hdoit.kylin.web.money.providers.ProjectOwnProvider;
import com.hdoit.kylin.web.money.providers.ReimbursementStateProvider;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
*@author liyaochong
*@email
*@createtime 2017年07月19日 10:05:26
*@comment
*/
public class ReimbursementConfig extends ModelMetadataAttributeConfiguration{
	public ReimbursementConfig(){
		this.setProperty("amount")
			.hasAttribute(new DisplayNameAttribute("金额"))
			.hasAttribute(new RequiredAttribute("金额为必填项"));
		
		this.setProperty("createDate")
			.hasAttribute(new DisplayNameAttribute("时间"))
			.hasAttribute(new RequiredAttribute("时间为必填项"))
			.hasAttribute(new DateTimeAttribute());

		this.setProperty("projectId")
			.hasAttribute(new DisplayNameAttribute("项目组名称"))
			.hasAttribute(new RequiredAttribute("项目组名称为必填项"))
			.hasAttribute(new DropDownListAttribute(new ProjectOwnProvider()));
		
		this.setProperty("moneyTypeId")
			.hasAttribute(new DisplayNameAttribute("财务科目"))
			.hasAttribute(new DropDownListAttribute(new MoneyTypeOwnProvider()));
		
		this.setProperty("state")
			.hasAttribute(new DisplayNameAttribute("状态"))
			.hasAttribute(new DropDownListAttribute(new ReimbursementStateProvider()));
		
		this.setProperty("receipt")
			.hasAttribute(new DisplayNameAttribute("收据"));
		
		this.setProperty("comments")
			.hasAttribute(new DisplayNameAttribute("用途"));
	}
}